package tedu.study.day05;

public class Day05Expand {
    public static void main(String[] args) {
        //getSumBy0();
        //get8();
        triangle(9);
    }

    public static int getSumBy0(){
        int sum=0;
        for(int i=1;i<=100;i++){
            if(i%2==0){
                sum+=i;
            }
        }
        System.out.println(sum);
        return sum;
    }

    public static int get8(){
        int num = 1;
        for(int i=1;i<=8;i++){
            num*=i;
        }
        System.out.println(num);
        return num;
    }

    public static void triangle(int n){
        for(int i=1;i<=n;i++){
            for(int j=1;j<=n-i;j++){//补足空格
                System.out.print(" ");
            }
            for(int j=1;j<=i*2-1;j++){
                System.out.print("*");
            }
            System.out.println();
        }

    }
}
